package com.haoe.mapper;

import com.haoe.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @Author: 80305082
 * @Date: 2021/3/12
 * @Description: 订单mapper
 */
@Repository
public interface OrderMapper {

    List<Order> selectByCustomerId(@Param("customerId") Long customerId);

    Long insert(@Param("order")Order order);

    Order selectById(@Param("id") Long id);

    void updateStatusById(@Param("id") Long id, @Param("status") Integer status);

    Order selectOrderByKeys(@Param("customerId") Long customerId, @Param("restaurantId") Long restaurantId, @Param("status") int status);

    List<Order> selectByRestaurantIdAndStatus(@Param("restaurantId") Long restaurantId, @Param("status") int status);

    List<Order> selectByRestaurantId(@Param("restaurantId") Long restaurantId, @Param("statusList") List<Integer> statusList);

    List<Order> selectByIds(@Param("customerId") Long customerId, @Param("restaurantId") Long restaurantId);
}
